package net.monare.mifss.admin.ui.valid;

import com.vaadin.data.validator.AbstractValidator;

public class IntIdValidator extends AbstractValidator<String> {

	private static final long serialVersionUID = -111126050606231072L;

	public IntIdValidator(String errorMessage){
		super(errorMessage);
	}

	@Override
	protected boolean isValidValue(String value) {
		
		
		int converted = 0; 
		
		try{
			converted = Integer.parseInt(value);
			
			if(converted>0){
				return true;
			} else {
				return false;
			}
			
		} catch(Exception e){
			return false;
		}
	}

	@Override
	public Class<String> getType() {
		return String.class;
	}

}
